package com.coflxl.web.api.common.service;

import com.coflxl.web.api.common.model.dto.ApiPage;
import com.coflxl.web.api.common.model.dto.SysCommonSearchPageDTO;
import com.coflxl.web.api.common.model.SysCommonSql;

import java.util.List;
import java.util.Map;

public interface CommonService {
    List search(String key, Map paramMap) throws Exception;

    Map searchByOne(String key, Map paramMap) throws Exception;

    ApiPage<Map> searchPage(String key, SysCommonSearchPageDTO pageDto) throws Exception;

    /**
     * 动态保存表
     * @param table  需要保存的表名字
     * @param paramMap   对应实体的参数
     * @return  返回主键ID
     */
    String saveOrUpdate(String table, Map<String, Object>  paramMap);

    Long addKey(String key, Map<String, Object> paramMap) throws Exception;
}
